package com.domor.xxx.system.controller.system;

import com.domor.xxx.common.core.controller.BaseController;
import com.domor.xxx.system.service.SysAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <h3>区域 控制层</h3>
 * 关于web选择省市县的demo详见pigfarm项目猪场管理模块
 * @author liyuyang
 * @date 2021/2/5
 **/
@RestController
@RequestMapping("/system/area")
public class SysAreaController extends BaseController {

    @Autowired
    private SysAreaService areaService;

    /**
     * 查询区域列表
     * pid为1时即查询所有省
     */
    @ResponseBody
    @PostMapping("/getAreasByPid")
    public Object getAreasByPid(int pid) {
        return areaService.getAreasByPid(pid);
    }

}
